package cn.elves.model.draw.service.algorithm.impl;

import cn.elves.model.draw.service.algorithm.BaseDrawAlgorithm;

import java.util.List;

/**
 *
 * @author 精灵
 * @time 2024-06-19   10:15
 */
public class ProbabilisticFixedDrawAlgorithm extends BaseDrawAlgorithm {

    @Override
    public String randomDraw(Long strategyId, List<String> excludeAwardIds) {
        String[] awardArr = rateTupleMap.get(strategyId);

        //生成一个随机数要求在0和awardArr数组的之间
        int randomAward = (int) (Math.random() * awardArr.length);
        String awardId = awardArr[randomAward];
        if(excludeAwardIds.contains(awardId)){
            return null;
        }
        return awardId;

    }

}
